package com.yic.module.mes.controller.admin.mo.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;

import static com.yic.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * 生产排产 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class MoBaseVO {

    @Schema(description = "工单号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "工单号不能为空")
    private String code;

    @Schema(description = "批次号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4322")
    @NotNull(message = "批次号不能为空")
    private String batchNo;

    @Schema(description = "生产计划", requiredMode = Schema.RequiredMode.REQUIRED, example = "4322")
    @NotNull(message = "生产计划不能为空")
    private Long planId;

    @Schema(description = "产品通用信息", requiredMode = Schema.RequiredMode.REQUIRED, example = "20672")
    @NotNull(message = "产品通用信息不能为空")
    private Long itemId;

    @Schema(description = "产品生产信息", requiredMode = Schema.RequiredMode.REQUIRED, example = "12791")
    @NotNull(message = "产品生产信息不能为空")
    private Long itemProduceId;

    @Schema(description = "上阶工单", example = "20411")
    private Long parentId;

    @Schema(description = "上阶工单")
    private String parentCode;

    @Schema(description = "排产数量", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "排产数量不能为空")
    private BigDecimal produceAmount;

    @Schema(description = "开工时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime startTime;

    @Schema(description = "完工时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime completeTime;

    @Schema(description = "报工数量")
    private BigDecimal reportAmount;

    @Schema(description = "合格数量")
    private BigDecimal qualifiedAmount;

    @Schema(description = "不合格数量")
    private BigDecimal unqualifiedAmount;

    @Schema(description = "入库数量")
    private BigDecimal inAmount;

    @Schema(description = "工厂", example = "14096")
    private Long factoryId;

    @Schema(description = "生产车间", example = "19906")
    private Long workshopId;

    @Schema(description = "部门", example = "18136")
    private Long deptId;

    @Schema(description = "工单工艺路线", example = "20513")
    private Long moRouteId;

    @Schema(description = "状态", example = "2")
    private Integer status;

    @Schema(description = "流水号类型", example = "2")
    private Integer snType;

    @Schema(description = "备注", example = "2")
    private String remark;


}
